package com.chainyoung.component_tmperson.ui.mvp.model;

import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmperson.api.PersonService;
import com.chainyoung.component_tmperson.entity.PreRepayment;
import com.chainyoung.component_tmperson.entity.WalletRepayment;
import com.chainyoung.component_tmperson.ui.mvp.contract.ConfirmRepayContract;
import com.chainyoung.component_tmperson.ui.mvp.contract.WalletRepaymentScheduleContract;

import java.util.List;
import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

public class ConfirmRepayModel extends BaseModel implements ConfirmRepayContract.Model {

    @Inject
    ConfirmRepayModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);

    }






    @Override
    public Flowable<PreRepayment> getPreRepaymentInfo(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .getPreRepayment(map)
                .compose(RxUtils.<PreRepayment>handleResult());
    }

    @Override
    public Flowable<String> confirmRepay(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .confirmRepay(map)
                .compose(RxUtils.<String>handleResult());
    }


}



